home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / devel-docs / libgimp / sgml / gimpgradients.sgml < prev    next >
Encoding:
Text File  |  2003-05-20  |  12.6 KB  |  288 lines

  1. <refentry id="libgimp-gimpgradients" revision="19 Jan 2001">
  2. <refmeta>
  3. <refentrytitle>gimpgradients</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. <refmiscinfo>LIBGIMP Library</refmiscinfo>
  6. </refmeta>
  7.  
  8. <refnamediv>
  9. <refname>gimpgradients</refname><refpurpose></refpurpose>
  10. </refnamediv>
  11.  
  12. <refsynopsisdiv><title>Synopsis</title>
  13. <synopsis>
  14.  
  15.  
  16.  
  17. <link linkend="gchar">gchar</link>**     <link linkend="gimp-gradients-get-list">gimp_gradients_get_list</link>         (<link linkend="gint">gint</link> *num_gradients);
  18. <link linkend="gchar">gchar</link>*      <link linkend="gimp-gradients-get-active">gimp_gradients_get_active</link>       (void);
  19. <link linkend="gboolean">gboolean</link>    <link linkend="gimp-gradients-set-active">gimp_gradients_set_active</link>       (<link linkend="gchar">gchar</link> *name);
  20. <link linkend="gdouble">gdouble</link>*    <link linkend="gimp-gradients-sample-uniform">gimp_gradients_sample_uniform</link>   (<link linkend="gint">gint</link> num_samples);
  21. <link linkend="gdouble">gdouble</link>*    <link linkend="gimp-gradients-sample-custom">gimp_gradients_sample_custom</link>    (<link linkend="gint">gint</link> num_samples,
  22.                                              <link linkend="gdouble">gdouble</link> *positions);
  23. <link linkend="gchar">gchar</link>*      <link linkend="gimp-gradients-get-gradient-data">gimp_gradients_get_gradient_data</link>
  24.                                             (<link linkend="gchar">gchar</link> *name,
  25.                                              <link linkend="gint">gint</link> *width,
  26.                                              <link linkend="gint">gint</link> sample_size,
  27.                                              <link linkend="gdouble">gdouble</link> **grad_data);
  28. <link linkend="gboolean">gboolean</link>    <link linkend="gimp-gradients-popup">gimp_gradients_popup</link>            (<link linkend="gchar">gchar</link> *gradients_callback,
  29.                                              <link linkend="gchar">gchar</link> *popup_title,
  30.                                              <link linkend="gchar">gchar</link> *initial_gradient,
  31.                                              <link linkend="gint">gint</link> sample_size);
  32. <link linkend="gboolean">gboolean</link>    <link linkend="gimp-gradients-close-popup">gimp_gradients_close_popup</link>      (<link linkend="gchar">gchar</link> *gradients_callback);
  33. <link linkend="gboolean">gboolean</link>    <link linkend="gimp-gradients-set-popup">gimp_gradients_set_popup</link>        (<link linkend="gchar">gchar</link> *gradients_callback,
  34.                                              <link linkend="gchar">gchar</link> *gradient_name);
  35. </synopsis>
  36. </refsynopsisdiv>
  37.  
  38.  
  39.  
  40.  
  41.  
  42. <refsect1>
  43. <title>Description</title>
  44. <para>
  45.  
  46. </para>
  47. </refsect1>
  48.  
  49. <refsect1>
  50. <title>Details</title>
  51. <refsect2>
  52. <title><anchor id="gimp-gradients-get-list">gimp_gradients_get_list ()</title>
  53. <programlisting><link linkend="gchar">gchar</link>**     gimp_gradients_get_list         (<link linkend="gint">gint</link> *num_gradients);</programlisting>
  54. <para>
  55. Retrieve the list of loaded gradients.
  56. </para>
  57. <para>
  58. This procedure returns a list of the gradients that are currently
  59. loaded in the gradient editor. You can later use the
  60. gimp_gradients_set_active function to set the active gradient.</para>
  61. <para>
  62.  
  63. </para><informaltable pgwide=1 frame="none" role="params">
  64. <tgroup cols="2">
  65. <colspec colwidth="2*">
  66. <colspec colwidth="8*">
  67. <tbody>
  68. <row><entry align="right"><parameter>num_gradients</parameter> :</entry>
  69. <entry> The number of loaded gradients.
  70. </entry></row>
  71. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The list of gradient names.
  72. </entry></row>
  73. </tbody></tgroup></informaltable></refsect2>
  74. <refsect2>
  75. <title><anchor id="gimp-gradients-get-active">gimp_gradients_get_active ()</title>
  76. <programlisting><link linkend="gchar">gchar</link>*      gimp_gradients_get_active       (void);</programlisting>
  77. <para>
  78. Retrieve the name of the active gradient.
  79. </para>
  80. <para>
  81. This procedure returns the name of the active gradient in the
  82. gradient editor.</para>
  83. <para>
  84.  
  85. </para><informaltable pgwide=1 frame="none" role="params">
  86. <tgroup cols="2">
  87. <colspec colwidth="2*">
  88. <colspec colwidth="8*">
  89. <tbody>
  90. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The name of the active gradient.
  91. </entry></row>
  92. </tbody></tgroup></informaltable></refsect2>
  93. <refsect2>
  94. <title><anchor id="gimp-gradients-set-active">gimp_gradients_set_active ()</title>
  95. <programlisting><link linkend="gboolean">gboolean</link>    gimp_gradients_set_active       (<link linkend="gchar">gchar</link> *name);</programlisting>
  96. <para>
  97. Sets the specified gradient as the active gradient.
  98. </para>
  99. <para>
  100. This procedure lets you set the specified gradient as the active or
  101. \"current\" one. The name is simply a string which corresponds to
  102. one of the loaded gradients in the gradient editor. If no matching
  103. gradient is found, this procedure will return an error. Otherwise,
  104. the specified gradient will become active and will be used for
  105. subsequent custom gradient operations.</para>
  106. <para>
  107.  
  108. </para><informaltable pgwide=1 frame="none" role="params">
  109. <tgroup cols="2">
  110. <colspec colwidth="2*">
  111. <colspec colwidth="8*">
  112. <tbody>
  113. <row><entry align="right"><parameter>name</parameter> :</entry>
  114. <entry> The name of the gradient to set.
  115. </entry></row>
  116. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
  117. </entry></row>
  118. </tbody></tgroup></informaltable></refsect2>
  119. <refsect2>
  120. <title><anchor id="gimp-gradients-sample-uniform">gimp_gradients_sample_uniform ()</title>
  121. <programlisting><link linkend="gdouble">gdouble</link>*    gimp_gradients_sample_uniform   (<link linkend="gint">gint</link> num_samples);</programlisting>
  122. <para>
  123. Sample the active gradient in uniform parts.
  124. </para>
  125. <para>
  126. This procedure samples the active gradient from the gradient editor
  127. in the specified number of uniform parts. It returns a list of
  128. floating-point values which correspond to the RGBA values for each
  129. sample. The minimum number of samples to take is 2, in which case
  130. the returned colors will correspond to the { 0.0, 1.0 } positions in
  131. the gradient. For example, if the number of samples is 3, the
  132. procedure will return the colors at positions { 0.0, 0.5, 1.0 }.</para>
  133. <para>
  134.  
  135. </para><informaltable pgwide=1 frame="none" role="params">
  136. <tgroup cols="2">
  137. <colspec colwidth="2*">
  138. <colspec colwidth="8*">
  139. <tbody>
  140. <row><entry align="right"><parameter>num_samples</parameter> :</entry>
  141. <entry> The number of samples to take.
  142. </entry></row>
  143. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
  144. </entry></row>
  145. </tbody></tgroup></informaltable></refsect2>
  146. <refsect2>
  147. <title><anchor id="gimp-gradients-sample-custom">gimp_gradients_sample_custom ()</title>
  148. <programlisting><link linkend="gdouble">gdouble</link>*    gimp_gradients_sample_custom    (<link linkend="gint">gint</link> num_samples,
  149.                                              <link linkend="gdouble">gdouble</link> *positions);</programlisting>
  150. <para>
  151. Sample the active gradient in custom positions.
  152. </para>
  153. <para>
  154. This procedure samples the active gradient from the gradient editor
  155. in the specified number of points. The procedure will sample the
  156. gradient in the specified positions from the list. The left endpoint
  157. of the gradient corresponds to position 0.0, and the right endpoint
  158. corresponds to 1.0. The procedure returns a list of floating-point
  159. values which correspond to the RGBA values for each sample.</para>
  160. <para>
  161.  
  162. </para><informaltable pgwide=1 frame="none" role="params">
  163. <tgroup cols="2">
  164. <colspec colwidth="2*">
  165. <colspec colwidth="8*">
  166. <tbody>
  167. <row><entry align="right"><parameter>num_samples</parameter> :</entry>
  168. <entry> The number of samples to take.
  169. </entry></row>
  170. <row><entry align="right"><parameter>positions</parameter> :</entry>
  171. <entry> The list of positions to sample along the gradient.
  172. </entry></row>
  173. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
  174. </entry></row>
  175. </tbody></tgroup></informaltable></refsect2>
  176. <refsect2>
  177. <title><anchor id="gimp-gradients-get-gradient-data">gimp_gradients_get_gradient_data ()</title>
  178. <programlisting><link linkend="gchar">gchar</link>*      gimp_gradients_get_gradient_data
  179.                                             (<link linkend="gchar">gchar</link> *name,
  180.                                              <link linkend="gint">gint</link> *width,
  181.                                              <link linkend="gint">gint</link> sample_size,
  182.                                              <link linkend="gdouble">gdouble</link> **grad_data);</programlisting>
  183. <para>
  184.  
  185. </para><informaltable pgwide=1 frame="none" role="params">
  186. <tgroup cols="2">
  187. <colspec colwidth="2*">
  188. <colspec colwidth="8*">
  189. <tbody>
  190. <row><entry align="right"><parameter>name</parameter> :</entry>
  191. <entry></entry></row>
  192. <row><entry align="right"><parameter>width</parameter> :</entry>
  193. <entry></entry></row>
  194. <row><entry align="right"><parameter>sample_size</parameter> :</entry>
  195. <entry></entry></row>
  196. <row><entry align="right"><parameter>grad_data</parameter> :</entry>
  197. <entry></entry></row>
  198. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
  199.  
  200. </entry></row>
  201. </tbody></tgroup></informaltable></refsect2>
  202. <refsect2>
  203. <title><anchor id="gimp-gradients-popup">gimp_gradients_popup ()</title>
  204. <programlisting><link linkend="gboolean">gboolean</link>    gimp_gradients_popup            (<link linkend="gchar">gchar</link> *gradients_callback,
  205.                                              <link linkend="gchar">gchar</link> *popup_title,
  206.                                              <link linkend="gchar">gchar</link> *initial_gradient,
  207.                                              <link linkend="gint">gint</link> sample_size);</programlisting>
  208. <para>
  209. Invokes the Gimp gradients selection.
  210. </para>
  211. <para>
  212. This procedure popups the gradients selection dialog.</para>
  213. <para>
  214.  
  215. </para><informaltable pgwide=1 frame="none" role="params">
  216. <tgroup cols="2">
  217. <colspec colwidth="2*">
  218. <colspec colwidth="8*">
  219. <tbody>
  220. <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
  221. <entry> The callback PDB proc to call when gradient selection is made.
  222. </entry></row>
  223. <row><entry align="right"><parameter>popup_title</parameter> :</entry>
  224. <entry> Title to give the gradient popup window.
  225. </entry></row>
  226. <row><entry align="right"><parameter>initial_gradient</parameter> :</entry>
  227. <entry> The name of the pattern to set as the first selected.
  228. </entry></row>
  229. <row><entry align="right"><parameter>sample_size</parameter> :</entry>
  230. <entry> Size of the sample to return when the gradient is changed.
  231. </entry></row>
  232. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
  233. </entry></row>
  234. </tbody></tgroup></informaltable></refsect2>
  235. <refsect2>
  236. <title><anchor id="gimp-gradients-close-popup">gimp_gradients_close_popup ()</title>
  237. <programlisting><link linkend="gboolean">gboolean</link>    gimp_gradients_close_popup      (<link linkend="gchar">gchar</link> *gradients_callback);</programlisting>
  238. <para>
  239. Popdown the Gimp gradient selection.
  240. </para>
  241. <para>
  242. This procedure closes an opened gradient selection dialog.</para>
  243. <para>
  244.  
  245. </para><informaltable pgwide=1 frame="none" role="params">
  246. <tgroup cols="2">
  247. <colspec colwidth="2*">
  248. <colspec colwidth="8*">
  249. <tbody>
  250. <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
  251. <entry> The name of the callback registered for this popup.
  252. </entry></row>
  253. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
  254. </entry></row>
  255. </tbody></tgroup></informaltable></refsect2>
  256. <refsect2>
  257. <title><anchor id="gimp-gradients-set-popup">gimp_gradients_set_popup ()</title>
  258. <programlisting><link linkend="gboolean">gboolean</link>    gimp_gradients_set_popup        (<link linkend="gchar">gchar</link> *gradients_callback,
  259.                                              <link linkend="gchar">gchar</link> *gradient_name);</programlisting>
  260. <para>
  261. Sets the current gradient selection in a popup.
  262. </para>
  263. <para>
  264. Sets the current gradient selection in a popup.</para>
  265. <para>
  266.  
  267. </para><informaltable pgwide=1 frame="none" role="params">
  268. <tgroup cols="2">
  269. <colspec colwidth="2*">
  270. <colspec colwidth="8*">
  271. <tbody>
  272. <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
  273. <entry> The name of the callback registered for this popup.
  274. </entry></row>
  275. <row><entry align="right"><parameter>gradient_name</parameter> :</entry>
  276. <entry> The name of the gradient to set as selected.
  277. </entry></row>
  278. <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
  279. </entry></row>
  280. </tbody></tgroup></informaltable></refsect2>
  281.  
  282. </refsect1>
  283.  
  284.  
  285.  
  286.  
  287. </refentry>
  288.